<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        /* 过渡动画 */
        .box-transition{
            width: 100px;
            height: 100px;
            background-color: aliceblue;
            display: flex;
            justify-content: center;
            align-items: center;
            
            transition: all 2s ease-in;
        }

        .box-transition:hover{
            width: 400px;
            height: 400px;
            background-color: aquamarine;

        }


        /* 自动以动画 */
        @keyframes shake {
            0%{
                transform: translateX(0);
            }

            50%{
                transform: translateX(50px);
            }

            100%{
                transform: translateX(0);
            }
        }

        .box-animation{
            width: 100px;
            height: 100px;
            background-color: aliceblue;
            display: flex;
            justify-content: center;
            align-items: center;
            animation: shake 2s infinite alternate;
        }



    </style>
</head>
<body>
    <!-- vue 中的动画也是通过 css3 中的 transition 与 animation 实现 -->
    <div class="box-transition">自定义过度动画</div>


    <div class="box-animation">自定义动画</div>
</body>
</html>